<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{{ title }}</title>
    <link rel="stylesheet" type="text/css" href="/assets/fonts/fonts.css">
    <style>
      html, body {
        box-sizing: border-box;
        margin: 0;
      }

      html {
        --bokeh-base-font: Bokeh;
        --bokeh-mono-font: BokehMono;
      }

      .container {
        box-sizing: inherit;
        padding: 10px;
      }

      .description {
        box-sizing: inherit;
        background: white;
        font-weight: bold;
        font-size: 14px;
        height: 20px;
        padding: 2px 0;
        white-space: nowrap;
      }

      .viewport {
        box-sizing: inherit;
      }
    </style>
    <script type="text/javascript" src="{{ js('bokeh') }}"></script>
    <script type="text/javascript" src="{{ js('bokeh-gl') }}"></script>
    <script type="text/javascript" src="{{ js('bokeh-api') }}"></script>
    <script type="text/javascript" src="{{ js('bokeh-widgets') }}"></script>
    <script type="text/javascript" src="{{ js('bokeh-tables') }}"></script>
    <script type="text/javascript" src="{{ js('bokeh-mathjax') }}"></script>
    <script type="text/javascript">
      Bokeh.settings.dev = true
      Bokeh.settings.force_webgl = true
      //Bokeh.settings.force_fields = true
    </script>
    <script type="text/javascript">
      const {require} = Bokeh
    </script>
  </head>
  <body>
    <div class="container"></div>
    <!-- Preload fonts. Remove this when https://github.com/bokeh/bokeh/issues/9448 is fixed. -->
    <script type="text/javascript">
      async function preload_fonts() {
        for (let i = 5; i < 36; i++) {
          await document.fonts.load(`normal ${i}px Bokeh`)
          await document.fonts.load(`bold ${i}px Bokeh`)
          await document.fonts.load(`italic normal ${i}px Bokeh`)
          await document.fonts.load(`normal ${i}px BokehMono`)

          await document.fonts.load(`normal ${i}px Stix`)
          await document.fonts.load(`bold ${i}px Stix`)
          await document.fonts.load(`italic normal ${i}px Stix`)
          await document.fonts.load(`italic bold ${i}px Stix`)
          await document.fonts.load(`normal ${i}px StixMath`)
        }
      }
    </script>
    <script type="text/javascript" src="/static/test/{{ main }}"></script>
    {%- if run %}
    <script>
      (async () => {
        await preload_fonts()
        const params = new URLSearchParams(location.search)
        await Tests.run_all(params.getAll("k"))
      })()
    </script>
    {% else %}
    <script>
      preload_fonts()
    </script>
    {% endif -%}
  </body>
</html>
